package lab01;
import java.util.Scanner;
public class Test11 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("请输入1-9999之间的数字：");
        int numble=sc.nextInt();
        int individual = 0;
        int ten = 0;
        int hundred = 0;
        int thousand = 0;
        individual = numble % 1000 % 100 % 10;
        ten = numble % 1000 % 100 / 10;
        hundred = numble % 1000 / 100;
        thousand = numble/1000;

        if ( thousand!= 0) {
            System.out.println("这是一个四位数。");
        }
        if (thousand == 0 & hundred != 0) {
            System.out.println("这是一个三位数。");
        }
        if (thousand == 0 & hundred == 0 & ten != 0) {
            System.out.println("这是一个两位数。");
        }
        if (thousand == 0 & hundred == 0 & ten == 0 & individual != 0) {
            System.out.println("这是一个个位数。");
        }
        if (thousand == individual & hundred == ten ||
                individual == ten & hundred == thousand || hundred == individual & thousand == 0){
            System.out.println("这是一个回文数。");
        }
        else {
            System.out.println("这不是一个回文数。");
        }
    }
}
